package connexion;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import rmi.IServeurRmi;

public class Connexion {
	
	static int port = 53000;
	
	public static IServeurRmi connecterServeur()
	{
		Registry registry;
		IServeurRmi serveur = null;
		
		try {
			registry = LocateRegistry.getRegistry(port);
			serveur = (IServeurRmi)registry.lookup("serveurRMI");
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		
		return serveur;
	}

}
